package com.wuyoucar.service;

import com.wuyoucar.common.ResultBean;
import com.wuyoucar.entity.TUser;
import com.wuyoucar.service.Impl.UserServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


@Component
@FeignClient(value = "provider-loginAndRegist",fallback = UserServiceImpl.class)
public interface UserService {

    @RequestMapping("/user/loginByName")
    public ResultBean getUser(@RequestBody TUser tUser);

    //使用手机号进行登录
    @RequestMapping("/user/loginByCode")
    public ResultBean loginByCode(@RequestParam("usertel") String usertel,@RequestParam("code") String code);

    //使用手机进行注册
    @RequestMapping("/user/registByPhone")
    public ResultBean registByPhone(@RequestParam("usertel") String usertel,@RequestParam("code") String code);

    //获取手机注册验证码
    @RequestMapping("/user/getCode/{usertel}")
    public ResultBean getCode(@PathVariable("usertel") String usertel);

    //获取手机登录验证码
    @RequestMapping("/user/loginCode/{usertel}")
    public ResultBean loginCode(@PathVariable("usertel")String usertel);

}
